package com.sun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sun.entity.Squad;
import com.sun.mapper.SquadMapper;
import com.sun.service.ISquadService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author SunRui
 * @since 2024-12-11
 */
@Service
public class SquadServiceImpl extends ServiceImpl<SquadMapper, Squad> implements ISquadService {

    @Autowired
    SquadMapper squadMapper;

    @Override
    public List<Squad> selectQuadList() {
        return squadMapper.selectList(null);
    }

    @Override
    public List<Squad> selectQuadListByName(String name) {
        QueryWrapper<Squad> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("name",name);
        return squadMapper.selectList(queryWrapper);
    }
}
